package action

import (
	"fmt"
	"server/im/entity"
	"server/im/protocol"
)

func ActionEcho(ctx entity.ServiceContext) {

	fmt.Println("echo", ctx)

	fmt.Println("in", ctx.Data, string(ctx.Data))

	ctx.RespChan <- entity.CoreResultModel{
		CoreOutModel: entity.CoreOutModel{
			GatewayOutModel: entity.GatewayOutModel{
				Data: ctx.Data,
				Cmd:  protocol.RespEcho,
			},
			GatewayId:    ctx.GatewayId,
			MsgType:      entity.MsgTypeNormal,
			ReceiverType: entity.ReceiverTypeSingle,
			Clients:      []string{ctx.UserUni},
		},
		ResultType: entity.CoreResultTypeAll,
	}
}
